<!-- static || fixed -->
<div class="navbar navbar-default navbar-fixed-top" role="navigation" style="display:block;">
<div class="container-fluid">
  <div class="navbar-header">
    <%= link_to root_path,:class=>"navbar-brand" do%>
      <span class="glyphicon glyphicon-home"></span> WDW
    <%end%>
  </div>
  <!-- <div class="navbar-collapse collapse"> -->
  <% if user_signed_in? %>
    <ul class="nav navbar-nav">

    <!-- <li><%= link_to "主页",root_path%></li> -->

    <% unless current_member.nil? %>
      <li class="dropdown">
        <a href="#" class="dropdown-toggle" data-toggle="dropdown" style="color:#428bca;"><%= current_project.name%><b class="caret"></b></a>
        <ul class="dropdown-menu">
          <li><%= link_to "项目文档", folders_path() %></li>
          <li><%= link_to "小组列表" , groups_path() %></li>
          <li><%= link_to "成员列表" , members_path() %></li>
          <li class="divider"></li>
          <!-- <li><%= link_to "借阅记录",applies_path() %></li> -->
          <li><%= link_to "共享记录",shares_path() %></li>
           <li class="divider"></li>
          <li><%= link_to "切换项目" ,edit_current_member_path %></li>
        </ul>
      </li>
      <form action="<%= search_docs_path %>" class="navbar-form navbar-left" role="search">
            <div class="form-group">
              <input type="text" class="form-control" placeholder="Search" name="k" value="<%= params[:k]%>">
            </div>
            <button type="submit" class="btn btn-primary">
            <span class="glyphicon glyphicon-search"></span>
            文档搜索</button>
          </form>

      <%end%>

      <ul class="nav navbar-nav">
          
            <li><%= link_to "切换项目",edit_current_member_path%></li>
             <!--  <li class="active"><a href="#">Home</a></li> -->
 <!--            <li><a href="#contact">Contact</a></li>
            <li class="dropdown">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <span class="caret"></span></a>
              <ul class="dropdown-menu" role="menu">
                <li><a href="#">Action</a></li>
                <li><a href="#">Another action</a></li>
                <li><a href="#">Something else here</a></li>
                <li class="divider"></li>
                <li class="dropdown-header">Nav header</li>
                <li><a href="#">Separated link</a></li>
                <li><a href="#">One more separated link</a></li>
              </ul>
            </li> -->
          </ul>
      <% if current_user.is_sys_admin %>
      <li class="dropdown">
        <a href="#" class="dropdown-toggle" data-toggle="dropdown">系统管理<b class="caret"></b></a>
        <ul class="dropdown-menu">
         <li><%= link_to "项目管理" , projects_path() %></li>
         <li><%= link_to "用户管理" , users_path() %></li>
         <li><%= link_to "系统详细" , system_path() %></li>
        </ul>
      </li>
      <%end%>
    </ul>
    <ul class="nav navbar-nav navbar-right">
      <li class="dropdown">
        <a href="#1" class="dropdown-toggle" data-toggle="dropdown">
        <span class="glyphicon glyphicon-user"></span> <%= current_user.name%> <b class="caret"></b></a>
        <ul class="dropdown-menu">
            <li><%= link_to "切换项目",current_member_path(),:method=>:delete %></li>
            <li><%= link_to "个人资料",profile_path%></li>
             <li><%= link_to "修改密码",edit_password_path%></li>
            <li><%= link_to "退出",destroy_user_session_path,method: :delete  %></li>
        </ul>
      </li>
    </ul>
   <!--  <div class="btn-group nav navbar-nav  navbar-right " style="margin-top:5px; ">
  <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" style="border-width:0px;">
    Action <span class="caret"></span>
  </button>
  <ul class="dropdown-menu" role="menu">
    <li><a href="#">Action</a></li>
    <li><a href="#">Another action</a></li>
    <li><a href="#">Something else here</a></li>
    <li class="divider"></li>
    <li><a href="#">Separated link</a></li>
  </ul>
</div> -->
  <%else%>
    <ul class="nav navbar-nav navbar-right">
      <li><%= link_to "登 录",new_user_session_path%></li>
    </ul>
  <%end%>
  <!-- </div> --><!--/.nav-collapse -->
</div>
</div>